/**
 * Created by Ren on 2015/6/6.
 */
function Stars(ctx, x, y, director, starArray)
{
    this.starImg = new Image();
    this.starImg.src = 'images/Star.png';
    this.picNo = 0;
    this.ctx = ctx;
    this.director = director;
    this.starArray = starArray;
    this.x = x;
    this.y = y;
}
Stars.prototype.draw = function()
{
    switch (this.director)
    {
        case 0:
            this.y+=0.5;
            break;
        case 1:
            this.x+=0.5;
            this.y+=0.5;
            break;
        case 2:
            this.x-=0.5;
            this.y+=0.5;
            break;
    }
    if(this.picNo > 7)
    {
        this.picNo = 0;
    }
    this.ctx.drawImage(this.starImg, this.picNo * 7, 0, 7, 7, this.x, this.y, 7, 7);
    this.picNo ++;
}